import untils from '../../utils/util' //相对地址
import {request} from "../../request/index.js"

const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list: [],
    wire: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(123)
  },
  onShow:function(){
    request({
      url: "/wire/list/inspect", 
      data: {
      }, 
      header: {
        'content-type': 'application/json' // 默认值
      }
    })
    .then(res => {
      this.setData({
        list: res.data
      })
    })
  },
  goReplace:function(e){
    request({
      url: "/wire/queryWireByWireName", 
      data: {
        wireName: e.currentTarget.id,
      }, 
      header: {
        'content-type': 'application/json' // 默认值
      }
    })
    .then(res => {
      var wire=JSON.stringify(res.data)
      wx.navigateTo({
        url: '../addWire/addWire?wire='+wire,
      })
    })
  }
})